package gui;

import java.awt.BorderLayout;
import java.awt.EventQueue;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;

import javax.imageio.ImageIO;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JTextField;
import javax.swing.border.EmptyBorder;
import javax.swing.JLabel;
import javax.swing.ImageIcon;
import java.awt.Color;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.GridLayout;
import java.awt.Image;
import java.awt.Rectangle;
import java.io.File;




public class Info extends JFrame{

	
	class ImagePanel extends JPanel {

		  private Image img;
			

		  public ImagePanel(String img) {
		    this(new ImageIcon(img).getImage());
		  }

		  public ImagePanel(Image img) {
		    this.img = img;
		    Dimension size = new Dimension(img.getWidth(null), img.getHeight(null));
		    setPreferredSize(size);
		    setMinimumSize(size);
		    setMaximumSize(size);
		    setSize(size);
		    setLayout(null);
		  }

		  public void paintComponent(Graphics g) {
		    g.drawImage(img, 0, 0, null);
		  }

		}

	
	
	
	
	private JPanel contentPane;
	private int width=650;
	private int height=650;

	/**
	 * Launch the application.
	 * @return 
	 */


		public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					Info frame = new Info();
					frame.setVisible(true);
					frame.setFocusable(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}


	/**
	 * Create the frame.
	 */
	public Info() 
	{
		setBounds(100, 100, 450, 300);
		setSize(width, height);
		setTitle("Infos zu dem Hotel");
		contentPane = new ImagePanel(new ImageIcon("C:\\Users\\Chris\\Desktop\\Desktop\\JavaWorkspace\\hotelexc\\bild1.jpg").getImage());
				
		//contentPane.setBackground(new Color(240, 240, 240));
		setVisible(true);
		setFocusable(true);
		setResizable(false);
		contentPane.setLayout(new BorderLayout(0, 0));
		setContentPane(contentPane);
		
		
		JPanel panel = new JPanel();
		JTextField tfname = new JTextField(20);
		
		

		
		
	}
	


		
	}





